home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / MachineExceptions.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  5.3 KB  |  154 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MachineExceptions.a
  3. ;
  4. ;    Contains:    Processor Exception Handling Interfaces .
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__MACHINEEXCEPTIONS__') = 'UNDEFINED' THEN
  21. __MACHINEEXCEPTIONS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28. ; typedef KernelID             AreaID
  29. ; Machine Dependent types for PowerPC: 
  30. MachineInformationPowerPC RECORD    0
  31. CTR                         ds     UnsignedWide ; offset: $0 (0)
  32. LR                         ds     UnsignedWide ; offset: $8 (8)
  33. PC                         ds     UnsignedWide ; offset: $10 (16)
  34. CR                         ds.l   1        ; offset: $18 (24)
  35. XER                         ds.l   1        ; offset: $1C (28)
  36. MSR                         ds.l   1        ; offset: $20 (32)
  37. sizeof                     EQU *            ; size:   $24 (36)
  38.                         ENDR
  39.  
  40. ; typedef struct MachineInformationPowerPC  MachineInformationPowerPC
  41. RegisterInformationPowerPC RECORD    0
  42. R0                         ds     UnsignedWide ; offset: $0 (0)
  43. R1                         ds     UnsignedWide ; offset: $8 (8)
  44. R2                         ds     UnsignedWide ; offset: $10 (16)
  45. R3                         ds     UnsignedWide ; offset: $18 (24)
  46. R4                         ds     UnsignedWide ; offset: $20 (32)
  47. R5                         ds     UnsignedWide ; offset: $28 (40)
  48. R6                         ds     UnsignedWide ; offset: $30 (48)
  49. R7                         ds     UnsignedWide ; offset: $38 (56)
  50. R8                         ds     UnsignedWide ; offset: $40 (64)
  51. R9                         ds     UnsignedWide ; offset: $48 (72)
  52. R10                         ds     UnsignedWide ; offset: $50 (80)
  53. R11                         ds     UnsignedWide ; offset: $58 (88)
  54. R12                         ds     UnsignedWide ; offset: $60 (96)
  55. R13                         ds     UnsignedWide ; offset: $68 (104)
  56. R14                         ds     UnsignedWide ; offset: $70 (112)
  57. R15                         ds     UnsignedWide ; offset: $78 (120)
  58. R16                         ds     UnsignedWide ; offset: $80 (128)
  59. R17                         ds     UnsignedWide ; offset: $88 (136)
  60. R18                         ds     UnsignedWide ; offset: $90 (144)
  61. R19                         ds     UnsignedWide ; offset: $98 (152)
  62. R20                         ds     UnsignedWide ; offset: $A0 (160)
  63. R21                         ds     UnsignedWide ; offset: $A8 (168)
  64. R22                         ds     UnsignedWide ; offset: $B0 (176)
  65. R23                         ds     UnsignedWide ; offset: $B8 (184)
  66. R24                         ds     UnsignedWide ; offset: $C0 (192)
  67. R25                         ds     UnsignedWide ; offset: $C8 (200)
  68. R26                         ds     UnsignedWide ; offset: $D0 (208)
  69. R27                         ds     UnsignedWide ; offset: $D8 (216)
  70. R28                         ds     UnsignedWide ; offset: $E0 (224)
  71. R29                         ds     UnsignedWide ; offset: $E8 (232)
  72. R30                         ds     UnsignedWide ; offset: $F0 (240)
  73. R31                         ds     UnsignedWide ; offset: $F8 (248)
  74. sizeof                     EQU *            ; size:   $100 (256)
  75.                         ENDR
  76.  
  77. ; typedef struct RegisterInformationPowerPC  RegisterInformationPowerPC
  78. FPUInformationPowerPC     RECORD    0
  79. Registers                 ds.b   32 * UnsignedWide.sizeof ; offset: $0 (0)
  80. FPSCR                     ds.l   1        ; offset: $100 (256)
  81. Reserved                 ds.l   1        ; offset: $104 (260)
  82. sizeof                     EQU *            ; size:   $108 (264)
  83.                         ENDR
  84.  
  85. ; typedef struct FPUInformationPowerPC  FPUInformationPowerPC
  86.  
  87. writeReference                    EQU        0
  88. readReference                    EQU        1
  89. fetchReference                    EQU        2
  90.  
  91. ; typedef unsigned long     MemoryReferenceKind
  92. MemoryExceptionInformation RECORD    0
  93. theArea                     ds.l   1        ; offset: $0 (0)
  94. theAddress                 ds.l   1        ; offset: $4 (4)
  95. theError                 ds.l   1        ; offset: $8 (8)
  96. theReference             ds.l   1        ; offset: $C (12)
  97. sizeof                     EQU *            ; size:   $10 (16)
  98.                         ENDR
  99.  
  100. ; typedef struct MemoryExceptionInformation  MemoryExceptionInformation
  101.  
  102. unknownException                EQU        0
  103. illegalInstructionException        EQU        1
  104. trapException                    EQU        2
  105. accessException                    EQU        3
  106. unmappedMemoryException            EQU        4
  107. excludedMemoryException            EQU        5
  108. readOnlyMemoryException            EQU        6
  109. unresolvablePageFaultException    EQU        7
  110. privilegeViolationException        EQU        8
  111. traceException                    EQU        9
  112. instructionBreakpointException    EQU        10
  113. dataBreakpointException            EQU        11
  114. integerException                EQU        12
  115. floatingPointException            EQU        13
  116. stackOverflowException            EQU        14
  117. terminationException            EQU        15
  118.  
  119. ; typedef unsigned long     ExceptionKind
  120. ExceptionInfo             RECORD    0
  121. memoryInfo                 ds.l   1        ; offset: $0 (0)
  122.                          ORG 4
  123. sizeof                     EQU *            ; size:   $4 (4)
  124.                         ENDR
  125.  
  126. ; typedef union ExceptionInfo  ExceptionInfo
  127. ExceptionInformationPowerPC RECORD    0
  128. theKind                     ds.l   1        ; offset: $0 (0)
  129. machineState             ds.l   1        ; offset: $4 (4)
  130. registerImage             ds.l   1        ; offset: $8 (8)
  131. FPUImage                 ds.l   1        ; offset: $C (12)
  132. info                     ds.l   1        ; offset: $10 (16)
  133. sizeof                     EQU *            ; size:   $14 (20)
  134.                         ENDR
  135.  
  136. ; typedef struct ExceptionInformationPowerPC  ExceptionInformationPowerPC
  137.     IF GENERATINGPOWERPC  THEN
  138. ; typedef ExceptionInformationPowerPC  ExceptionInformation
  139. ; typedef MachineInformationPowerPC  MachineInformation
  140. ; typedef RegisterInformationPowerPC  RegisterInformation
  141. ; typedef FPUInformationPowerPC  FPUInformation
  142.     ENDIF
  143. ; Note:    An ExceptionHandler is NOT a UniversalProcPtr.
  144. ;            It must be a native function pointer with NO routine descriptor. 
  145. ; Routine for installing per-process exception handlers 
  146. ;
  147. ; pascal ExceptionHandler InstallExceptionHandler(ExceptionHandler theHandler)
  148. ;
  149.     IF GENERATINGCFM THEN
  150.         IMPORT_CFM_FUNCTION    InstallExceptionHandler
  151.     ENDIF
  152.  
  153.     ENDIF ; __MACHINEEXCEPTIONS__
  154.